<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<fieldset><legend>查询条件</legend>
<form method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>网站</th>
	<td>
		<select name="shop_id">
			<?foreach ($shop as $s):?>
			<option value="<?=$s['id']?>" <?if (isset($_GET['shop_id']) && $_GET['shop_id']==$s['id']) echo "selected='selected'"?>><?=$s['name']?></option>
			<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<td></td>
	<td><input type="submit" value="查询" class="button"/></td>
</tr>
</table>
</form>
</fieldset>

<h2><a href="<?=url('DataCenter::Marketing/GAData')?>">返回数据中心首页</a></h2>
<table width="100%" class="list_table">
<tr>
	<th>日期</th>
	<th>注册量</th>
	<th>订单数量</th>
	<th>订单总金额</th>
	<th>单张订单金额</th>
</tr>
<?foreach ($data as $d):?>
<tr>
	<th><?=date('Y-m', $d['date'])?></th>
	<td><?=$d['reg_count']?></td>
	<td><?=$d['order_count']?></td>
	<td>
		$<?=number_format($d['order_amount'], 2)?><br/>
		￥<?=number_format($d['order_amount'] * $currency_rate, 2)?>
	</td>
	<td>$<?=$d['order_count'] ? number_format($d['order_amount']/$d['order_count'], 2) : '0.00'?></td>
</tr>
<?endforeach;?>
</table>
<?php $this->_endblock();?>